package com.it.web.controller;


import com.it.common.aspect.ApiOperationLog;
import com.it.common.utils.Response;
import com.it.web.model.dto.tag.FindTagArticlePageListDto;
import com.it.web.model.dto.tag.FindTagListDto;
import com.it.web.service.TagService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/tag")
@Api(tags = "标签")
public class TagController {

    @Resource
    private TagService tagService;



    @PostMapping("/list")
    @ApiOperation(value = "前台获取标签列表")
    @ApiOperationLog(description = "前台获取标签列表")
    public Response findTagList(FindTagListDto findTagListDto) {

        return tagService.findTagList(findTagListDto);
    }

    @PostMapping("/article/list")
    @ApiOperation(value = "前台获取标签下文章列表")
    @ApiOperationLog(description = "前台获取标签下文章列表")
    public Response findTagPageList(@RequestBody @Validated FindTagArticlePageListDto findTagArticlePageListDto){
        return tagService.findTagPageList(findTagArticlePageListDto);
    }

}
